<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>fstatvfs</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_005_311">&nbsp;</a>NAME</h4><blockquote>
fstatvfs, statvfs - get file system information
</blockquote><h4><a name = "tag_000_005_312">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="sysstatvfs.h.html">sys/statvfs.h</a>&gt;

int fstatvfs(int <i>fildes</i>, struct statvfs *<i>buf</i>);
int statvfs(const char *<i>path</i>, struct statvfs *<i>buf</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_000_005_313">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>fstatvfs()</i>
function obtains information about the file system containing the file
referenced by <i>fildes</i>.
<p>
The following flags can be returned in the <b>f_flag</b> member:
<dl compact>

<dt>ST_RDONLY<dd>
Read-only file system.

<dt>ST_NOSUID<dd>
Setuid/setgid bits ignored by exec.

</dl>
<p>
The
<i><a href="statvfs.html">statvfs()</a></i>
function obtains descriptive information about the file system containing the
file named by <i>path</i>.
<p>
For both functions, the <i>buf</i> argument is a pointer to a <b>statvfs</b>
structure that will be filled.  Read, write, or execute permission of the
named file is not required, but all directories listed in the pathname leading
to the file must be searchable.
<p>
It is unspecified whether all members of the <b>statvfs</b>
structure have meaningful values on all file systems.
</blockquote><h4><a name = "tag_000_005_314">&nbsp;</a>RETURN VALUE</h4><blockquote>
Upon successful completion,
<i><a href="statvfs.html">statvfs()</a></i>
returns 0.  Otherwise, it returns -1 and sets <i>errno</i> to indicate the
error.
</blockquote><h4><a name = "tag_000_005_315">&nbsp;</a>ERRORS</h4><blockquote>
The
<i>fstatvfs()</i>
and
<i><a href="statvfs.html">statvfs()</a></i>
functions will fail if:
<dl compact>

<dt>[EIO]<dd>
An I/O error occurred while reading the file system.

<dt>[EINTR]<dd>
A signal was caught during execution of the function.

<dt>[EOVERFLOW]<dd>
One of the values to be returned cannot be represented correctly in
the structure pointed to by 
<b>buf</b>.

</dl>
<p>
The
<i>fstatvfs()</i>
function will fail if:
<dl compact>

<dt>[EBADF]<dd>
The <i>fildes</i> argument is not an open file descriptor.

</dl>
<p>
The
<i><a href="statvfs.html">statvfs()</a></i>
function will fail if:
<dl compact>

<dt>[EACCES]<dd>
Search permission is denied on a component of the <i>path</i> prefix.

<dt>[ELOOP]<dd>
Too many symbolic links were encountered in resolving <i>path</i>.

<dt>[ENAMETOOLONG]<dd>

The length of a pathname exceeds {PATH_MAX}, or a pathname
component is longer than {NAME_MAX}.

<dt>[ENOENT]<dd>
A component of <i>path</i> does not name an existing file
or <i>path</i> is an empty string.

<dt>[ENOTDIR]<dd>
A component of the path prefix of <i>path</i> is not a directory.

</dl>
<br>
<p>
The
<i><a href="statvfs.html">statvfs()</a></i>
function may fail if:
<dl compact>

<dt>[ENAMETOOLONG]<dd>

Pathname resolution of a symbolic link produced an intermediate result whose
length exceeds {PATH_MAX}.

</dl>
</blockquote><h4><a name = "tag_000_005_316">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_005_317">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_005_318">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_005_319">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="chmod.html">chmod()</a></i>,
<i><a href="chown.html">chown()</a></i>,
<i><a href="creat.html">creat()</a></i>,
<i><a href="dup.html">dup()</a></i>,
<i><a href="exec.html">exec</a></i>,
<i><a href="fcntl.html">fcntl()</a></i>,
<i><a href="link.html">link()</a></i>,
<i><a href="mknod.html">mknod()</a></i>,
<i><a href="open.html">open()</a></i>,
<i><a href="pipe.html">pipe()</a></i>,
<i><a href="read.html">read()</a></i>,
<i><a href="time.html">time()</a></i>,
<i><a href="unlink.html">unlink()</a></i>,
<i><a href="utime.html">utime()</a></i>,
<i><a href="write.html">write()</a></i>,
<i><a href="sysstatvfs.h.html">&lt;sys/statvfs.h&gt;</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
